/*
 * DART.h
 *
 *  Created on: May 23, 2011
 *      Author: ulas
 */

#ifndef DART_H_
#define DART_H_

#include "CLProtocol.h"
#include "vCLDART.h"

typedef struct
{
		U8 requiredSlots;
		DEVICE_CHANNEL_TYPE DeviceChannel;
}NEW_SLOTS_TYPE;  //3 BYTES

typedef struct
{
		DEVICE_CHANNEL_TYPE DeviceChannel;
}FREE_SLOTS_TYPE; //2 BYTES

typedef struct
{
		U8  numberOfNew;
		U8	numberOfFree;
		NEW_SLOTS_TYPE  New[DART_MAX_FREE_COUNT];
		FREE_SLOTS_TYPE Free[DART_MAX_NEW_COUNT];
}DART_MESSAGE_PARAMETER_TYPE;


class DART: public CLProtocol {
private:
	vCLDART* vCL;

public:
	DART(U8 nodeId);

	STATUS gUpdate(const U8* msg, const U16 messageLength);
	STATUS gRealTime(SLOT_TYPE* RTCL);
	STATUS gMySlot(myCL_TYPE* myCL);

	U16 prepareCLHeader(U8* msg, void* parPtr);
	U8 getCLHeaderLength(U8* msg);
	void updateCountForDART();

	virtual ~DART();
};

#endif /* DART_H_ */
